package flc.ast.adapter;

import androidx.annotation.NonNull;

import com.chad.library.adapter.base.provider.BaseItemProvider;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import flc.ast.R;
import flc.ast.bean.MyScaleBean;
import stark.common.basic.adaptermutil.StkProviderMultiAdapter;
import stark.common.basic.adaptermutil.StkSingleSpanProvider;

public class ScaleAdapter extends StkProviderMultiAdapter<MyScaleBean> {

    public ScaleAdapter() {
        addItemProvider(new StkSingleSpanProvider(126));
        addItemProvider(new ScaleProvider());
    }

    private class ScaleProvider extends BaseItemProvider<MyScaleBean> {
        @Override
        public int getItemViewType() {
            return StkProviderMultiAdapter.TYPE_VIEW;
        }

        @Override
        public int getLayoutId() {
            return R.layout.item_scale;
        }

        @Override
        public void convert(@NonNull BaseViewHolder baseViewHolder, MyScaleBean bean) {
            baseViewHolder.setImageResource(R.id.ivScaleItemImg, bean.getImg());
        }
    }

}
